package com.dces.demo.executor.service.jobhandler;

import com.xdo.dataimport.base.ImportBase;
import com.xdo.dataimport.utils.XdoImportLogger;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zyzhu
 */
@Component
@Slf4j
public class ImportJobHandler {
    /**
     * 初始化导入执行分配器
     */
    @Autowired
    private ImportBase importBase;

    /**
     * 导入服务执行器入口
     * @param strSystemCode 系统标识
     * @return 执行结果
     * @throws Exception
     */
    @XxlJob("importJobHandler")
    public ReturnT<String> execute(String strSystemCode) throws Exception {
        XdoImportLogger.log("XXL-JOB调度importJobHandler成功");
        return importBase.execute(strSystemCode);
    }
}
